#include<bits/stdc++.h>
using namespace std;
int m1[] = {0, 1, 3, 5, 7, 8, 10, 12};
int m2[] = {0, 4, 6, 9, 11};

int main() {
	int year1 = 1921, month1 = 7, day = 23;
	int year2 = 2020, month2 = 7, day2 = 1;
	int num = 0;
	while (1) {
		num += 24 * 60;
		day++;
		for (int i = 0 ; i < 8 ; i++ ) {
			if (month1 == m1[i] && day == 32) {
				month1++;
				day = 1;
				break;
			}
		}
		for (int i = 0 ; i < 5 ; i++) {
			if (month1 == m2[i] && day == 31) {
				month1++;
				day = 1;
				break;
			}
		}
		if (month1 == 2) {
			if ((year1 % 4 == 0 && year1 % 100 != 0) || year1 % 400 == 0) {
				if(day == 30)
				{
					month1++;
					day =1;
				}
			} 
			else
			{
				if(day == 29)
				{
					month1++;
					day = 1;
				}
			}
		}
		if(month1 == 13)
		{
			year1++;
			month1 = 1;
		}
		if(year1 == year2 && month1 == month2 && day == day2)
		{
			cout<<num<<endl;
			break;
		}
	}
}
